From edc40d10faa63ad6d20e93505e48d0ae2904c745 Mon Sep 17 00:00:00 2001 From: Max Semenik Date: Fri, 18 Jun 2010 19:39:08 +0000 Subject: [PATCH] Fixed hit counter on SQLite --- includes/Article.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/includes/Article.php b/includes/Article.php index 9dc80741ec..862a81bf30 100644 --- a/includes/Article.php +++ b/includes/Article.php @@ -4048,8 +4048,9 @@ class Article { $pageTable = $dbw->tableName( 'page' ); $hitcounterTable = $dbw->tableName( 'hitcounter' ); $acchitsTable = $dbw->tableName( 'acchits' ); + $dbType = $dbw->getType(); - if ( $wgHitcounterUpdateFreq <= 1 ) { + if ( $wgHitcounterUpdateFreq <= 1 || $dbType == 'sqlite' ) { $dbw->query( "UPDATE $pageTable SET page_counter = page_counter + 1 WHERE page_id = $id" ); return; @@ -4076,7 +4077,6 @@ class Article { wfProfileIn( 'Article::incViewCount-collect' ); $old_user_abort = ignore_user_abort( true ); - $dbType = $dbw->getType(); $dbw->lockTables( array(), array( 'hitcounter' ), __METHOD__, false ); $tabletype = $dbType == 'mysql' ? "ENGINE=HEAP " : ''; $dbw->query( "CREATE TEMPORARY TABLE $acchitsTable $tabletype AS " . -- 2.20.1